import store from "@/store"
import util from '@/utils/util.js'

export default {
    mounted(){
        if(util.isPhone(store.phoneMaxWidth)){
            store.phone = true
        }
        window.addEventListener('resize', () => {
            let phone = util.isPhone(store.phoneMaxWidth)
            store.commit('setIsPhone',phone)
        })

        //一上来就先检查一次
        let phone = util.isPhone(store.phoneMaxWidth)
        store.commit('setIsPhone',phone)
    },

    beforeDestroy(){
        window.removeEventListener('resize')
    }

}